
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QApplication>
#include <QFileSystemModel>
#include <QTreeView>
#include <QVBoxLayout>
#include <QWidget>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QMimeData>
#include <QProcess>
#include <QDesktopServices>
#include <QMenu>
#include <QGridLayout>
#include<QListView>
#include <windows.h>
#include<QStackedWidget>


QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

//zzh改
class MyListView : public QListView {
    Q_OBJECT

public:
    explicit MyListView(QWidget* parent = nullptr);




protected:
    void dragEnterEvent(QDragEnterEvent* event) override;
    void dropEvent(QDropEvent* event) override;
};


class CustomWindow : public QWidget
{
    Q_OBJECT

public:
    explicit CustomWindow(QWidget *parent = nullptr){};
    explicit CustomWindow(const QString& path,QWidget *parent = nullptr);
    bool Copyfile(const QString &srcFilePath, const QString &destFilePath);
    bool CopyFolder(const QString &srcFilePath, const QString &destFilePath);
    void startCopyProcess(const QString& srcPath, const QString& destPath);
    void setPath(QString& Path);

private slots:
    void openFile(const QModelIndex &index);
    void CopyActionActionTriggered();
    void PasteActionActionTriggered();
    void ClippingActionTriggered();
    void onOpenActionTriggered();
    void DeleteActionTriggered();

    void uninstallActionTriggered();

    void onButtonClick();

protected:
    void dragEnterEvent(QDragEnterEvent *event) override;
    void dropEvent(QDropEvent *event) override;
    void contextMenuEvent(QContextMenuEvent* event)override;

private:
    QTreeView *treeView;
    QFileSystemModel *model;
    QString path;
    QMenu* contextMenu;
    QGridLayout *gridLayout;
    MyListView *listView;
    QString currentDirectory;
    QStackedWidget *stackedWidget;
    //zzh改
    QStringList selectedIndexes;

    // QWidget interface
protected:
    void closeEvent(QCloseEvent *event);
};



#endif // MAINWINDOW_H
